﻿<!-- 
   Copyright 2011 LUCA Studios LLC & John Evans

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

	 http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
					xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
					xmlns:controls="clr-namespace:LUCAStudios.Silverlight.Controls" 
					xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
					xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
					xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" 
					xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
                    xmlns:System="clr-namespace:System;assembly=mscorlib" mc:Ignorable="d">


    <!-- converter declarations -->
    <controls:InvertOrientation x:Key="InvertOrientation"/>

    <!-- 
	******************************
	Commons Style resources
	******************************
	-->
    <!-- Palette -->
    <Color x:Key="lucaLightColor">WhiteSmoke</Color>
    <Color x:Key="lucaDarkColor">#252525</Color>
    <Color x:Key="lucaMidColor">#AAAAAA</Color>
    <Color x:Key="lucaTabItemHoverColor">WhiteSmoke</Color>
    <Color x:Key="lucaTabItemSelectedColor">WhiteSmoke</Color>
    <Color x:Key="lucaTextColor">#252525</Color>
    <Color x:Key="lucaWindowBackgroundColor1">#44aaFF</Color>
    <Color x:Key="lucaWindowBackgroundColor2">#CCEEFF</Color>

    <!-- Brushes -->
    <SolidColorBrush x:Key="lucaTextBrush" Color="{StaticResource lucaTextColor}" />

    <SolidColorBrush x:Key="lucaToolbarItemBackground" Color="{StaticResource lucaDarkColor}"/>

    <SolidColorBrush x:Key="lucaThemeForegroundBrush" Color="{StaticResource lucaTextColor}"/>

    <LinearGradientBrush x:Key="lucaThemeBackgroundBrush">
        <GradientStop Color="{StaticResource lucaMidColor}" />
        <GradientStop Color="{StaticResource lucaLightColor}" Offset="1" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="lucaWindowChromeBrush">
        <GradientStop Color="{StaticResource lucaLightColor}" />
        <GradientStop Color="#DDDDDD" Offset=".5" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="lucaWindowBackgroundBrush">
        <GradientStop Color="{StaticResource lucaWindowBackgroundColor1}" />
        <GradientStop Color="{StaticResource lucaWindowBackgroundColor2}" Offset="1" />
    </LinearGradientBrush>

    <SolidColorBrush x:Key="lucaThemeDarkBrush" Color="{StaticResource lucaDarkColor}" />

    <SolidColorBrush x:Key="lucaThemeBorderBrush" Color="{StaticResource lucaMidColor}" />

    <SolidColorBrush x:Key="lucaThemeTabItemNormalBrush" Color="{StaticResource lucaMidColor}" />

    <SolidColorBrush x:Key="LUCAThemeMenuItemIconBackgroundBrush" Color="White" />

    <SolidColorBrush x:Key="LUCAThemeMenuItemBackgroundBrush" Color="{StaticResource lucaLightColor}" />

    <SolidColorBrush x:Key="LUCAThemeMenuItemSeparatorBrush" Color="{StaticResource lucaMidColor}" />

    <SolidColorBrush x:Key="LUCAThemeLUCAMenuStripBackgroundBrush" Color="{StaticResource lucaLightColor}" />

    <SolidColorBrush x:Key="LUCAThemeLUCAMenuStripForgroundBrush" Color="{StaticResource lucaTextColor}" />

    <!-- Styles -->

    <Style TargetType="Border" x:Key="borderDefault">
        <Setter Property="BorderBrush" Value="{StaticResource lucaThemeBorderBrush}" />
        <Setter Property="BorderThickness" Value="1" />
    </Style>

    <Style TargetType="Border" x:Key="borderWindowRootStyle">
        <Setter Property="Padding" Value="4" />
        <Setter Property="BorderBrush" Value="White"/>
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="CornerRadius" Value="5" />
    </Style>

    <Style TargetType="Border" x:Key="borderWindowEdgeHighlightStyle">
        <Setter Property="Padding" Value="4" />
    </Style>

    <Style TargetType="Border" x:Key="borderWindowBackgroundStyle">
        <Setter Property="CornerRadius" Value="5" />
        <Setter Property="Background" Value="{StaticResource lucaWindowBackgroundBrush}" />
        <Setter Property="Padding" Value="4" />
        <Setter Property="Opacity" Value=".5" />
    </Style>

    <Style TargetType="Border" x:Key="borderWindowEdgesStyle">
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="BorderThickness" Value="2" />
    </Style>

    <Style TargetType="Border" x:Key="borderWindowContentStyle">
        <Setter Property="BorderBrush" Value="{StaticResource lucaThemeBorderBrush}" />
        <Setter Property="BorderThickness" Value="1" />
    </Style>

    <Style TargetType="Border" x:Key="borderWindowChromeTitleBackground">
        <Setter Property="Background" Value="White"/>
        <Setter Property="HorizontalAlignment" Value="Left" />
    </Style>

    <Style TargetType="Border" x:Key="borderChromeStyle">
        <Setter Property="Padding" Value="2" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="MinHeight" Value="30"/>
    </Style>

    <Style TargetType="Border" x:Key="borderHighlight">
        <Setter Property="BorderBrush" Value="#FF08FF00" />
        <Setter Property="BorderThickness" Value="2" />
    </Style>

    <Style TargetType="Border" x:Key="borderToolbarChromeDots">
        <Setter Property="BorderBrush" Value="{StaticResource lucaThemeDarkBrush}" />
        <Setter Property="BorderThickness" Value="1" />

        <Setter Property="Margin" Value="2" />
        <Setter Property="Width" Value="2"/>
        <Setter Property="Height" Value="2"/>
    </Style>

    <Style TargetType="StackPanel" x:Key="toolbarChrome">
        <Setter Property="Background" Value="{StaticResource lucaWindowChromeBrush}"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Orientation" Value="Horizontal"/>
        <Setter Property="Margin" Value="2" />
    </Style>

    <Style TargetType="Border" x:Key="LUCAMenuStripTextBorder">
        <Setter Property="Padding" Value="7,0,7,0"/>
        <Setter Property="Background" Value="{StaticResource LUCAThemeLUCAMenuStripBackgroundBrush}"/>
    </Style>

    <Style TargetType="TextBlock" x:Key="LUCAMenuStripText">
        <Setter Property="Foreground" Value="{StaticResource lucaTextColor}"/>
        <Setter Property="FontSize" Value="12"/>
    </Style>

    <Style TargetType="Border" x:Key="LUCAThemeMenuItemHighlight">
        <Setter Property="Margin" Value="2,1,2,1"/>
        <Setter Property="Visibility" Value="Collapsed" />
        <Setter Property="Grid.ColumnSpan" Value="4" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="CornerRadius" Value="3" />
        <Setter Property="BorderBrush" Value="#FFD0BE00" />
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFD6CE00" Offset="1"/>
                    <GradientStop Color="White"/>
                    <GradientStop Color="#FFFFFCB1" Offset="0.531"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="Button" x:Key="lucaWindowTabButton">
        <Setter Property="Margin" Value="3,3,3,0" />
        <Setter Property="Height" Value="15" />
        <Setter Property="Background" Value="#FF1F3B53"/>
        <Setter Property="Foreground" Value="#FF000000"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFA3AEB9" Offset="0"/>
                    <GradientStop Color="#FF8399A9" Offset="0.375"/>
                    <GradientStop Color="#FF718597" Offset="0.375"/>
                    <GradientStop Color="#FF617584" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                	<Storyboard>
                                		<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="border">
                                			<DiscreteObjectKeyFrame KeyTime="0">
                                				<DiscreteObjectKeyFrame.Value>
                                					<Visibility>Visible</Visibility>
                                				</DiscreteObjectKeyFrame.Value>
                                			</DiscreteObjectKeyFrame>
                                		</ObjectAnimationUsingKeyFrames>
                                	</Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                	<Storyboard>
                                		<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="border">
                                			<DiscreteObjectKeyFrame KeyTime="0">
                                				<DiscreteObjectKeyFrame.Value>
                                					<Visibility>Visible</Visibility>
                                				</DiscreteObjectKeyFrame.Value>
                                			</DiscreteObjectKeyFrame>
                                		</ObjectAnimationUsingKeyFrames>
                                		<DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="border" d:IsOptimized="True"/>
                                		<DoubleAnimation Duration="0" To="0.8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="border" d:IsOptimized="True"/>
                                	</Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                	<Storyboard>
                                		<DoubleAnimation Duration="0" To="0.35" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
                                	</Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                            	<VisualState x:Name="Focused"/>
                            	<VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="border" BorderBrush="Black" BorderThickness="1" Visibility="Collapsed" RenderTransformOrigin="0.5,0.5">
                        	<Border.RenderTransform>
                        		<CompositeTransform/>
                        	</Border.RenderTransform>
                        </Border>
                    	<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="Button" x:Key="LUCAWindowChromeButton">
        <Setter Property="Background" Value="#FF1F3B53"/>
        <Setter Property="Foreground" Value="#FF000000"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFA3AEB9" Offset="0"/>
                    <GradientStop Color="#FF8399A9" Offset="0.375"/>
                    <GradientStop Color="#FF718597" Offset="0.375"/>
                    <GradientStop Color="#FF617584" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                                        <ColorAnimation Duration="0" To="#F2FFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                        <ColorAnimation Duration="0" To="#CCFFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                        <ColorAnimation Duration="0" To="#7FFFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ColorAnimation Duration="0" To="#FF6DBDD1" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" Storyboard.TargetName="Background"/>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                                        <ColorAnimation Duration="0" To="#D8FFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                        <ColorAnimation Duration="0" To="#C6FFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                        <ColorAnimation Duration="0" To="#8CFFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                        <ColorAnimation Duration="0" To="#3FFFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="White" CornerRadius="3">
                            <Grid Background="{TemplateBinding Background}" Margin="1">
                                <Border x:Name="BackgroundAnimation" Background="#FF448DCA" Opacity="0"/>
                                <Rectangle x:Name="BackgroundGradient">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
                                            <GradientStop Color="#FFFFFFFF" Offset="0"/>
                                            <GradientStop Color="#F9FFFFFF" Offset="0.375"/>
                                            <GradientStop Color="#E5FFFFFF" Offset="0.625"/>
                                            <GradientStop Color="#C6FFFFFF" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Grid>
                        </Border>
                        <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        <Rectangle x:Name="DisabledVisualElement" Fill="#FFFFFFFF" IsHitTestVisible="false" Opacity="0" RadiusY="3" RadiusX="3"/>
                        <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Margin="1" Opacity="0" RadiusY="2" RadiusX="2" Stroke="#FF6DBDD1" StrokeThickness="1"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Control Templates -->

    <Style TargetType="controls:LUCAMenuStrip">
        <Setter Property="Background" Value="{StaticResource LUCAThemeLUCAMenuStripBackgroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource LUCAThemeLUCAMenuStripForgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:LUCAMenuStrip">
                    <Grid x:Name="LUCALUCAMenuStripRoot">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Grid x:Name="LUCALUCAMenuStripTitleWrapper" Background="{TemplateBinding Background}">
                            <ItemsControl x:Name="LUCALUCAMenuStripTitleCollection" ItemsSource="{TemplateBinding Titles}">
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <StackPanel VerticalAlignment="Center" HorizontalAlignment="Left" Orientation="Horizontal"/>
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <Grid Background="Transparent">
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="DefaultStates">
                                                    <VisualState x:Name="Hover">
                                                        <Storyboard>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderLUCAMenuStripTitle">
                                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                                    <DiscreteObjectKeyFrame.Value>
                                                                        <Visibility>Visible</Visibility>
                                                                    </DiscreteObjectKeyFrame.Value>
                                                                </DiscreteObjectKeyFrame>
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                    <VisualState x:Name="Normal"/>
                                                    <VisualState x:Name="Selected">
                                                        <Storyboard>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderLUCAMenuStripTitle">
                                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                                    <DiscreteObjectKeyFrame.Value>
                                                                        <Visibility>Visible</Visibility>
                                                                    </DiscreteObjectKeyFrame.Value>
                                                                </DiscreteObjectKeyFrame>
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </VisualState>
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <VisualStateManager.CustomVisualStateManager>
                                                <ei:ExtendedVisualStateManager/>
                                            </VisualStateManager.CustomVisualStateManager>
                                            <Border Margin="0" CornerRadius="2" HorizontalAlignment="Stretch" IsHitTestVisible="false" x:Name="borderLUCAMenuStripTitle" Style="{StaticResource LUCAThemeMenuItemHighlight}">
                                            </Border>
                                            <TextBlock Padding="7,2,7,2" IsHitTestVisible="false" x:Name="tbMenuTitle" Style="{StaticResource LUCAMenuStripText}" Text="{Binding}"/>
                                        </Grid>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                        </Grid>
                        <ContentPresenter x:Name="LUCALUCAMenuStripContentPresenter" Grid.Row="1" Content="{TemplateBinding LUCAMenuStripContent}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:Menu">
        <Setter Property="Background" Value="{StaticResource LUCAThemeMenuItemBackgroundBrush}"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Grid.ColumnSpan" Value="99"/>
        <Setter Property="Grid.RowSpan" Value="99"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:Menu">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Border Margin="0,-1,0,0" Grid.Row="1" VerticalAlignment="Top" BorderThickness="1" BorderBrush="{StaticResource lucaThemeDarkBrush}" >
                            <ItemsControl ItemsSource="{TemplateBinding Children}">
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <StackPanel Orientation="Vertical"/>
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                            </ItemsControl>
                        </Border>
                        <Border x:Name="borderTitle" Padding="7,3,7,3" HorizontalAlignment="Left" VerticalAlignment="Top" Background="{StaticResource LUCAThemeMenuItemBackgroundBrush}" BorderThickness="1,1,1,0" BorderBrush="{StaticResource lucaThemeDarkBrush}">
                            <TextBlock Style="{StaticResource LUCAMenuStripText}" Text="{TemplateBinding Title}"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:MenuItem">
        <Setter Property="Foreground" Value="{StaticResource lucaThemeDarkBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:MenuItem">
                    <Grid x:Name="gridMenuItemWrapper" Height="25" Background="{StaticResource LUCAThemeMenuItemBackgroundBrush}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="VisualStateGroup">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Hover">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.495" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="textBlock" d:IsOptimized="True"/>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="textBlock1" d:IsOptimized="True"/>
                                        <DoubleAnimation Duration="0" To="0.495" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="textBlock2" d:IsOptimized="True"/>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter" d:IsOptimized="True"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="30px"/>
                            <ColumnDefinition Width="1*"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="30px"/>
                        </Grid.ColumnDefinitions>
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="MouseEnter">
                                <ei:GoToStateAction StateName="Hover"/>
                            </i:EventTrigger>
                            <i:EventTrigger EventName="MouseLeave">
                                <ei:GoToStateAction StateName="Normal"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                        <Border IsHitTestVisible="False" Background="{StaticResource LUCAThemeMenuItemIconBackgroundBrush}"/>
                        <Border Style="{StaticResource LUCAThemeMenuItemHighlight}" x:Name="borderBackground" IsHitTestVisible="False" />
                        <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Adornment}" />
                        <Grid IsHitTestVisible="False" Grid.Column="1" >
                            <TextBlock x:Name="textBlock" Margin="10,0,0,0" VerticalAlignment="Center" Text="{TemplateBinding Text}"/>
                        </Grid>
                        <Grid IsHitTestVisible="False" x:Name="gridAccelerator" Grid.Column="2">
                            <TextBlock x:Name="textBlock1" VerticalAlignment="Center" Text="{TemplateBinding AcceleratorKeys}"/>
                        </Grid>
                        <Grid IsHitTestVisible="False" Visibility="Collapsed" x:Name="gridSubMenuIdentifier" Grid.Column="3">
                            <TextBlock FontSize="9" x:Name="textBlock2" VerticalAlignment="Center" HorizontalAlignment="Center" Text="►"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:MenuItemSeparator">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:MenuItemSeparator">
                    <Grid Height="5" Background="{StaticResource LUCAThemeMenuItemBackgroundBrush}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="30px"/>
                            <ColumnDefinition Width="1*"/>
                        </Grid.ColumnDefinitions>
                        <Grid Background="{StaticResource LUCAThemeMenuItemIconBackgroundBrush}"/>
                        <Grid Grid.Column="1" >
                            <Border Margin="5,0,5,0" VerticalAlignment="Center" BorderThickness="1" BorderBrush="{StaticResource LUCAThemeMenuItemSeparatorBrush}"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:LUCALayoutPanel">
        <Setter Property="Background" Value="{StaticResource lucaThemeBackgroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource lucaThemeForegroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:LUCALayoutPanel">
                    <Grid x:Name="rootVisual" 
						  Height="{TemplateBinding Height}" 
						  Width="{TemplateBinding Width}" 
						  Background="{TemplateBinding Background}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <ContentPresenter Content="{TemplateBinding LUCAMenuStripContext}"/>
                        <ItemsControl Grid.Row="1" ItemsSource="{TemplateBinding Children}">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <Grid />
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                        </ItemsControl>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:LUCAToolBarSeparator">
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:LUCAToolBarSeparator">
                    <Border Background="{StaticResource lucaThemeDarkBrush}" BorderBrush="{StaticResource lucaThemeDarkBrush}" BorderThickness="{TemplateBinding BorderThickness}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:LUCAToolBarItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:LUCAToolBarItem">
                    <Grid Margin="5" Background="{TemplateBinding Background}">
                        <ContentPresenter Content="{TemplateBinding CurrentContent}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:LUCAToolBar">
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="BorderBrush" Value="{StaticResource lucaThemeDarkBrush}"/>
        <Setter Property="Background" Value="{StaticResource lucaThemeBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:LUCAToolBar">
                    <Border BorderThickness="1" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" >
                        <StackPanel Orientation="{TemplateBinding Orientation}">
                            <Border x:Name="borderChrome" Background="Transparent">
                                <StackPanel Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" >
                                    <controls:BindingHelper.Binding>
                                        <controls:BindingProperties
										TargetProperty="Orientation"
										SourceProperty="Orientation"
										RelativeSourceAncestorType="LUCAToolBar"
										Converter="{StaticResource InvertOrientation}"/>
                                    </controls:BindingHelper.Binding>
                                    <Border Style="{StaticResource borderToolbarChromeDots}"/>
                                    <Border Style="{StaticResource borderToolbarChromeDots}"/>
                                    <Border Style="{StaticResource borderToolbarChromeDots}"/>
                                    <Border Style="{StaticResource borderToolbarChromeDots}"/>
                                    <Border Style="{StaticResource borderToolbarChromeDots}"/>
                                </StackPanel>
                            </Border>
                            <ItemsControl ItemsSource="{TemplateBinding Children}">
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                                            <controls:BindingHelper.Binding>
                                                <controls:BindingProperties 
													TargetProperty="Orientation" 
													SourceProperty="Orientation"
													RelativeSourceAncestorType="LUCAToolBar"/>
                                            </controls:BindingHelper.Binding>
                                        </StackPanel>
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                            </ItemsControl>
                        </StackPanel>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:LUCAStackPanel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:LUCAStackPanel">
                    <Grid/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:LUCATabWindow">
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="Background" Value="{StaticResource lucaThemeBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:LUCATabWindow">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="WindowDisplayMode">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="NoUI">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderChrome">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderRight">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderLeft">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderTop">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderBottom">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderTopLeft">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderTopRight">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderBottomLeft">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderBottomRight">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Padding)" Storyboard.TargetName="borderRoot">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)" Storyboard.TargetName="borderRoot">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)" Storyboard.TargetName="borderContent">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <!--<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="contentPresenter">
											<DiscreteObjectKeyFrame KeyTime="0">
												<DiscreteObjectKeyFrame.Value>
													<Visibility>Collapsed</Visibility>
												</DiscreteObjectKeyFrame.Value>
											</DiscreteObjectKeyFrame>
										</ObjectAnimationUsingKeyFrames>-->
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Docked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderChrome">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderRight">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderLeft">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderTop">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderBottom">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderTopLeft">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderTopRight">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderBottomLeft">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderBottomRight">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Padding)" Storyboard.TargetName="borderRoot">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)" Storyboard.TargetName="borderRoot">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)" Storyboard.TargetName="borderContent">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)" Storyboard.TargetName="borderChrome">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0,1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border Style="{StaticResource borderWindowBackgroundStyle}"></Border>
                        <Border Style="{StaticResource borderWindowEdgeHighlightStyle}"></Border>
                        <Border Style="{StaticResource borderWindowRootStyle}" x:Name="borderRoot">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
                                <Border Padding="0,2,2,0" Style="{StaticResource borderChromeStyle}" x:Name="borderChrome">
                                    <Grid Margin="5,0,5,0" VerticalAlignment="Stretch">
                                        <Grid MinHeight="30" HorizontalAlignment="Stretch" VerticalAlignment="Center">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="1*" />
                                                <ColumnDefinition Width="Auto" />
                                            </Grid.ColumnDefinitions>
                                            <ItemsControl HorizontalAlignment="Stretch" ItemsSource="{TemplateBinding Children}">
                                                <ItemsControl.ItemsPanel>
                                                    <ItemsPanelTemplate>
                                                        <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" />
                                                    </ItemsPanelTemplate>
                                                </ItemsControl.ItemsPanel>
                                            </ItemsControl>
                                            <Button Visibility="{TemplateBinding CloseButtonVisibility}" Style="{StaticResource LUCAWindowChromeButton}" Margin="0,0,0,3" x:Name="btnCloseWindow" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center">
                                                <Button.Content>
                                                    <Grid MinWidth="20" MinHeight="20">
                                                        <TextBlock  HorizontalAlignment="Center" VerticalAlignment="Center" Text="X"></TextBlock>
                                                    </Grid>
                                                </Button.Content>
                                            </Button>
                                        </Grid>
                                    </Grid>
                                </Border>
                                <Border Style="{StaticResource borderWindowEdgesStyle}" x:Name="borderRight" Margin="0,0,-4,0" Grid.RowSpan="2" HorizontalAlignment="Right" Cursor="SizeWE" />
                                <Border Style="{StaticResource borderWindowEdgesStyle}" x:Name="borderLeft" Margin="-4,0,0,0" Grid.RowSpan="2" HorizontalAlignment="Left" Cursor="SizeWE" />
                                <Border Style="{StaticResource borderWindowEdgesStyle}" x:Name="borderTop" Margin="0,-4,0,0" VerticalAlignment="Top" Cursor="SizeNS" />
                                <Border Style="{StaticResource borderWindowEdgesStyle}" x:Name="borderBottom" Margin="0,0,0,-4" Grid.Row="1" VerticalAlignment="Bottom" Cursor="SizeNS" />
                                <Border Style="{StaticResource borderWindowEdgesStyle}" x:Name="borderTopLeft" Margin="-4,-4,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Cursor="SizeNWSE" />
                                <Border Style="{StaticResource borderWindowEdgesStyle}" x:Name="borderTopRight" Margin="0,-4,-4,0" HorizontalAlignment="Right" VerticalAlignment="Top" Cursor="SizeNESW" />
                                <Border Style="{StaticResource borderWindowEdgesStyle}" x:Name="borderBottomLeft" Margin="-4,0,0,-4" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Bottom" Cursor="SizeNESW" />
                                <Border Style="{StaticResource borderWindowEdgesStyle}" x:Name="borderBottomRight" Margin="0,0,-4,-4" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Cursor="SizeNWSE" />
                                <Border Background="{TemplateBinding Background}" x:Name="borderContent" Grid.Row="1">
                                    <ScrollViewer BorderBrush="{x:Null}" Padding="0" x:Name="contentScrollViewer"
									HorizontalScrollBarVisibility="{TemplateBinding HorizontalScrollBarVisibility}"
									VerticalScrollBarVisibility="{TemplateBinding VerticalScrollBarVisibility}">
                                        <ContentPresenter Content="{TemplateBinding CurrentContent}" />
                                    </ScrollViewer>
                                </Border>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:LUCATabItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:LUCATabItem">
                    <!-- The -5 margin adds a nice little overlap to the visual when placed in a horizontal stackpanel.. -->
                    <Border Margin="-5,0,0,0" x:Name="border" CornerRadius="5,25,0,0" Background="{StaticResource lucaThemeTabItemNormalBrush}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="MouseEnter">
                                    <Storyboard>
                                        <ColorAnimation Duration="0" To="{StaticResource lucaTabItemHoverColor}" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" Storyboard.TargetName="border" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ColorAnimation Duration="0" To="{StaticResource lucaTabItemSelectedColor}" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" Storyboard.TargetName="border" d:IsOptimized="True" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="btnCloseTab">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="UnChecked" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid Margin="5,0,10,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <TextBlock TextWrapping="NoWrap" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{TemplateBinding Title}" Margin="5,0" />
                            <Button Style="{StaticResource lucaWindowTabButton}" x:Name="btnCloseTab" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed">
                                <Button.Content>
                                    <TextBlock Margin="0,-5,0,0" Text="x"></TextBlock>
                                </Button.Content>
                            </Button>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:LUCAWindow">
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="Background" Value="{StaticResource lucaThemeBackgroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:LUCAWindow">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="WindowDisplayMode">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="NoUI">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderChrome">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderRight">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderLeft">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderTop">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderBottom">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderTopLeft">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderTopRight">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderBottomLeft">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderBottomRight">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Padding)" Storyboard.TargetName="borderRoot">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)" Storyboard.TargetName="borderRoot">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)" Storyboard.TargetName="borderContent">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Docked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderChrome">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderRight">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderLeft">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderTop">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderBottom">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderTopLeft">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderTopRight">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderBottomLeft">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderBottomRight">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Padding)" Storyboard.TargetName="borderRoot">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)" Storyboard.TargetName="borderRoot">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)" Storyboard.TargetName="borderContent">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)" Storyboard.TargetName="borderChrome">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0,1</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border Style="{StaticResource borderWindowBackgroundStyle}"></Border>
                        <Border Style="{StaticResource borderWindowEdgeHighlightStyle}"></Border>
                        <Border Style="{StaticResource borderWindowRootStyle}" x:Name="borderRoot">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
                                <Border Style="{StaticResource borderChromeStyle}" x:Name="borderChrome">
                                    <Grid Margin="5,0,5,0">
                                        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Center">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto" />
                                                <ColumnDefinition Width="1*" />
                                                <ColumnDefinition Width="Auto" />
                                            </Grid.ColumnDefinitions>
                                            <ContentPresenter Grid.Column="0" VerticalAlignment="Center">
                                                <!-- This type of special binding is necessary to support runtime theming -->
                                                <controls:BindingHelper.Binding>
                                                    <controls:BindingProperties
												TargetProperty="Content"
												SourceProperty="WindowIcon"
												RelativeSourceAncestorType="LUCAWindow"/>
                                                </controls:BindingHelper.Binding>
                                            </ContentPresenter>
                                            <ContentPresenter Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center">
                                                <!-- This type of special binding is necessary to support runtime theming -->
                                                <controls:BindingHelper.Binding>
                                                    <controls:BindingProperties
												TargetProperty="Content"
												SourceProperty="Title"
												RelativeSourceAncestorType="LUCAWindow"/>
                                                </controls:BindingHelper.Binding>
                                            </ContentPresenter>
                                            <Grid Grid.Column="2" VerticalAlignment="Center">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="Auto" />
                                                    <ColumnDefinition Width="Auto" />
                                                    <ColumnDefinition Width="Auto" />
                                                </Grid.ColumnDefinitions>
                                                <Button Visibility="{TemplateBinding MinimizeButtonVisibility}" Style="{StaticResource LUCAWindowChromeButton}" x:Name="btnMinimizeWindow">
                                                    <Button.Content>
                                                        <Grid MinWidth="20" MinHeight="20">
                                                            <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Text="_"></TextBlock>
                                                        </Grid>
                                                    </Button.Content>
                                                </Button>
                                                <Button Visibility="{TemplateBinding MaximizeButtonVisibility}" Style="{StaticResource LUCAWindowChromeButton}" Grid.Column="1" x:Name="btnMaximizeWindow">
                                                    <Button.Content>
                                                        <Grid MinWidth="20" MinHeight="20">
                                                            <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Text="O"></TextBlock>
                                                        </Grid>
                                                    </Button.Content>
                                                </Button>
                                                <Button Visibility="{TemplateBinding CloseButtonVisibility}" Style="{StaticResource LUCAWindowChromeButton}" Grid.Column="2" x:Name="btnCloseWindow">
                                                    <Button.Content>
                                                        <Grid MinWidth="20" MinHeight="20">
                                                            <TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Text="X"></TextBlock>
                                                        </Grid>
                                                    </Button.Content>
                                                </Button>
                                            </Grid>
                                        </Grid>
                                    </Grid>
                                </Border>
                                <ContentPresenter Grid.Row="1" Content="{TemplateBinding LUCAMenuStripContext}"></ContentPresenter>
                                <Border Style="{StaticResource borderWindowEdgesStyle}" x:Name="borderRight" Margin="0,0,-4,0" Grid.RowSpan="3" HorizontalAlignment="Right" Cursor="SizeWE" />
                                <Border Style="{StaticResource borderWindowEdgesStyle}" x:Name="borderLeft" Margin="-4,0,0,0" Grid.RowSpan="3" HorizontalAlignment="Left" Cursor="SizeWE" />
                                <Border Style="{StaticResource borderWindowEdgesStyle}" x:Name="borderTop" Margin="0,-4,0,0" VerticalAlignment="Top" Cursor="SizeNS" />
                                <Border Style="{StaticResource borderWindowEdgesStyle}" x:Name="borderBottom" Margin="0,0,0,-4" Grid.Row="2" VerticalAlignment="Bottom" Cursor="SizeNS" />
                                <Border Style="{StaticResource borderWindowEdgesStyle}" x:Name="borderTopLeft" Margin="-4,-4,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Cursor="SizeNWSE" />
                                <Border Style="{StaticResource borderWindowEdgesStyle}" x:Name="borderTopRight" Margin="0,-4,-4,0" HorizontalAlignment="Right" VerticalAlignment="Top" Cursor="SizeNESW" />
                                <Border Style="{StaticResource borderWindowEdgesStyle}" x:Name="borderBottomLeft" Margin="-4,0,0,-4" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" Cursor="SizeNESW" />
                                <Border Style="{StaticResource borderWindowEdgesStyle}" x:Name="borderBottomRight" Margin="0,0,-4,-4" Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom" Cursor="SizeNWSE" />
                                <Border Style="{StaticResource borderWindowContentStyle}" Background="{TemplateBinding Background}" x:Name="borderContent"  Grid.Row="2">
                                    <ScrollViewer BorderBrush="{x:Null}" Padding="0" x:Name="contentScrollViewer"
									HorizontalScrollBarVisibility="{TemplateBinding HorizontalScrollBarVisibility}"
									VerticalScrollBarVisibility="{TemplateBinding VerticalScrollBarVisibility}">
                                        <ContentPresenter>
                                            <!-- This type of special binding is necessary to support runtime theming -->
                                            <controls:BindingHelper.Binding>
                                                <controls:BindingProperties
												TargetProperty="Content"
												SourceProperty="CurrentContent"
												RelativeSourceAncestorType="LUCAWindow"/>
                                            </controls:BindingHelper.Binding>
                                        </ContentPresenter>
                                    </ScrollViewer>
                                </Border>
                            </Grid>
                        </Border>
                    </Grid>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>